static void gdbstub_console_puts(const char *str);
/* value <-> char (de)serialzers */
-char
+static char
hex2char(unsigned long x)
{
const char array[] = "0123456789abcdef";
-
return array[x & 15];
}
-int
+static unsigned int
char2hex(unsigned char c)
{
if ( (c >= '0') && (c <= '9') )
return -1;
}
-char
+static unsigned char
str2hex(const char *str)
{
return (char2hex(str[0]) << 4) | char2hex(str[1]);
}
-unsigned long
+static unsigned long
str2ulong(const char *str, unsigned long bytes)
{
unsigned long x = 0;
return x;
}
-unsigned long
+static unsigned long
str_to_native_ulong(const char *str)
{
unsigned long x = 0, i = 0;
{
#ifdef __BIG_ENDIAN
x <<= 8;
- x += str2hex(*str);
+ x += str2hex(str);
#elif defined(__LITTLE_ENDIAN)
- x += (unsigned long)str2hex(*str) << (i*8);
+ x += (unsigned long)str2hex(str) << (i*8);
#else
# error unknown endian
#endif
#ifdef CRASH_DEBUG
-/* value <-> char (de)serialzers for arch specific gdb backends */
-char hex2char(unsigned long x);
-int char2hex(unsigned char c);
-char str2hex(const char *str);
-unsigned long str2ulong(const char *str, unsigned long bytes);
-
struct gdb_context {
int serhnd; /* handle on our serial line */
int console_steal_id; /* handle on stolen console */